<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"  isELIgnored="false"%>
<%@ page import="java.util.*,com.hengpeng.itfinbase.persist.AppGroup"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="chtml" uri="http://www.szhelper.com/jsp/html"%>
<title>添加分组</title>
<script type="text/javascript">
	function onsubmits() {
		var sels = document.getElementById("appgroup_store_self");

		for ( var i = 0; i < sels.length; i++) {
			sels.options[i].selected = true;
		}
		return true;
	}
</script>
</head>
<body>
<div class="youarehere">权限管理  &gt; <span>管理系统组</span>&gt; <span>添加分组</span></div>
<div id="content"><chtml:command command="appgroup" title="添加组"
	onSubmit="onsubmits()" action="/acm/appgroup/save" exclude="parent">
	
	<chtml:property index="-1" label="所属分组">
		<select name="parent">
			<%
				out.println("<option value='0'>--无--</option>");
					Set<AppGroup> set = (Set<AppGroup>) request.getAttribute("sortlist");
					for (AppGroup group : set)
					{
						String text = "&nbsp;";
						if (group.getParent() == null)
						{
							text = "&nbsp;";
						}
						else
						{
							AppGroup parent = group.getParent();
							while (parent != null)
							{
								text = text + "&nbsp;&nbsp;";
								parent = parent.getParent();
							}
							text += "┕";
						}
						text = text + group.getName();
						out.println("<option value='" + group.getId() + "'>" + text + "</option>");
					}
			%>
		</select>
	</chtml:property>
	<chtml:property index="-1" label="代理商">
		<table border="0">
			<tr>
				<td><SELECT tabindex="1" id="appgroup_store_all"
					NAME="appgroup_store_all" multiple="multiple"
					style="width: 140px; height: 230px;">
					<c:forEach items="${requestScope.storeList}" var="store">
						<option value="${store.id }">${store.name }</option>
					</c:forEach>
				</SELECT></td>
				<td style="width: 65px; text-align: center;"><a href="#" onclick="javascript:helper.fun.moveSelectItem('appgroup_store_all','appgroup_store_self')";>添加</a><br>
				<br>
				<a href="#" onclick="javascript:helper.fun.moveSelectItem('appgroup_store_self','appgroup_store_all')";>移除</a>
				</td>
				<td><SELECT tabindex="1" id="appgroup_store_self"
					NAME="storeIds" multiple="multiple"
					style="width: 140px; height: 230px;">
				</SELECT></td>
			</tr>
		</table>
	</chtml:property>
	<chtml:button destination="/acm/appgroup/save" showText="创建"></chtml:button>
</chtml:command></div>
	<!--说明   -->	
<div class="sm_info">
	<p class="row_one">说明：</p>
	<p class="other"></p>
	<p class="other"></p>
</div>
</body>
</html>